import Vue from 'vue'
import {
  mapState
} from 'vuex';

const globalMixin = {
  created() {},
  data() {
    return {}
  },
  methods: {},
  computed: {
    filter() {
      return {
        country: this.selectCountry.map(item => item.location_id),
        retailer: this.selectRetailer.map(item => item.id),
        brands: this.selectBrands.map(item => item.id),
        material: this.selectMaterial.map(item => item.id),
        color: this.selectColor.map(item => item.id),
        type: this.selectType.map(item => item.id),
        condition: this.selectCondition.map(item => item.id),
        collection: this.selectCollection.map(item=> item.id)
      }
    },
    ...mapState([
      "selectCountry",
      "selectRetailer",
      "selectBrands",
      "selectMaterial",
      "selectColor",
      "selectType",
      "selectCondition",
      "selectCollection"
    ]),
  }
}

Vue.mixin(globalMixin)
